all:

deb: deb-clean
	#do not make this target default or dpkg-buildpackage while loop forever
	cd src; make clean
	cd src; make
	export DEBEMAIL="samuel.ventura@yeico.com"
	export DEBFULLNAME="Samuel Ventura"
	dh_make -p relayduino_0.2 --createorig -m -e samuel.ventura@yeico.com -c apache
	cp -f pkg/* debian/
	dpkg-buildpackage -b -rfakeroot

install:
	mkdir -p $(DESTDIR)/usr/bin
	mkdir -p $(DESTDIR)/usr/share/icons/hicolor/48x48/apps
	mkdir -p $(DESTDIR)/usr/share/applications
	install src/relayduino-cli $(DESTDIR)/usr/bin
	install src/relayduino-gtk $(DESTDIR)/usr/bin
	install src/relayduino.desktop $(DESTDIR)/usr/share/applications
	install -m 644 src/relayduino.png $(DESTDIR)/usr/share/icons/hicolor/48x48/apps

deb-clean:
	#do not use clean target for this since it gets called from dpkg-buildpackage
	rm -f ../relayduino_*.gz
	rm -f ../relayduino_*.changes
	rm -f ../relayduino_*.dsc
	rm -f ../relayduino_*.deb
	rm -fR debian

